<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserGroup extends Model
{
    protected  $table='user_group';

    protected $fillable = [
        'user_id',
        'volunteer_group_id',
    ];

    public function group() {
        return $this->belongsTo('App\Models\VolunteerGroup', 'volunteer_group_id', 'id');
    }

    public function user() {
        return $this->belongsTo('App\User', 'user_id', 'id');
    }

    public function volunteer() {
        return $this->belongsTo('App\Models\Volunteer', 'user_id', 'user_id');
    }
}
